﻿@using JLP.DB
@{
    ViewData["Title"] = "Home Page";
    var products = (List<Product>)this.ViewData["Products"];
}

<div class="text-center">
    <h1 class="display-4">Welcome</h1>
    <p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
    <hr />
    <h1>Products</h1>
    <table class="table-active">
        <thead>
            <tr>
                <th style="width:100px;">ID</th>
                <th style="width:300px;">名称</th>
                <th style="width:300px;">价格(USD $)</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var product in products)
            {
                <tr>
                    <td>@product.ID</td>
                    <td>@product.Name</td>
                    <td>@product.Price.ToString("F2")</td>
                </tr>
            }
        </tbody>
    </table>
</div>
